package org.netwia.networks;

import java.util.NoSuchElementException;

/**
 * Defines functionality of the input provider.
 * Input provider serves data to the node.
 * 
 * @author radek.hecl
 *
 * @param <T> type of the parameter
 */
public interface InputProvider<T> {

    /**
     * Returns true if next input is ready, false otherwise.
     * If next input is ready, then method getNextInput can be called 1 time without risking the exception.
     * 
     * @return true if input is ready, false otherwise 
     */
    public boolean isNextInputReady();
    
    /**
     * Returns the next input.
     * 
     * @return next input
     * @throws NoSuchElementException if there is no input ready
     */
    public T getNextInput();
}
